﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SAM.Framework.Javascript
{
    /// <summary>
    /// c# 与 js的数据交换接口
    /// </summary>
    public interface IExchange
    {
        /// <summary>
        /// 添加一个类型给JS编译环境
        /// </summary>
        /// <param name="type">类型</param>
        void AddHostType(Type type);

        /// <summary>
        /// 添加一上对象给JS编译环境
        /// </summary>
        /// <param name="name">对象在JS用的名称</param>
        /// <param name="hostObject">对象实例</param>
        void AddHostObject(string name, object hostObject);
    }
}
